HipAudioClip

Wraps a decoder onto it. Basically an easier interface with some more controls that would be needed inside specific APIs.

AudioClip flow basically consists in: 1. Initialize the audio clip with the current decoder. 2. Call .load, which calls .decode 3. HipAudioSource calls .setClip, which should call clip.getBuffer, which gets the buffer wrapped by the current implementation createBuffer, and then the buffer is enqueued.

Constructors

this
this()
Undocumented in source.
this
this(IHipAudioDecoder decoder, HipAudioClipHint hint)
Undocumented in source.
this
this(IHipAudioDecoder decoder, HipAudioClipHint hint, uint chunkSize)
Undocumented in source.

Members

Functions

_getBufferAPI
HipAudioBufferAPI* _getBufferAPI(ubyte[] data, uint size)
Undocumented in source. Be warned that the author may not have intended to support it.
createBuffer
HipAudioBufferWrapper createBuffer(ubyte[] data)

Always alocates a pointer to the buffer data. So, after getting its content. Send it to the recyclable buffers

destroyBuffer
void destroyBuffer(HipAudioBuffer* buffer)
Undocumented in source.
findBuffer
HipAudioBufferWrapper* findBuffer(HipAudioBuffer buf)
Undocumented in source. Be warned that the author may not have intended to support it.
getAudioClipBackend
IHipAudioClip getAudioClipBackend()
Undocumented in source. Be warned that the author may not have intended to support it.
getBuffer
HipAudioBuffer getBuffer(ubyte[] data, uint size)
Undocumented in source. Be warned that the author may not have intended to support it.
getClipData
ubyte[] getClipData()

Returns the streambuffer if streamed, else, returns entire sound

getClipSize
size_t getClipSize()

Returns how much has been decoded

getDecodedDuration
float getDecodedDuration()
Undocumented in source. Be warned that the author may not have intended to support it.
getDuration
float getDuration()
Undocumented in source. Be warned that the author may not have intended to support it.
getHint
immutable(HipAudioClipHint)* getHint()
Undocumented in source. Be warned that the author may not have intended to support it.
getSampleRate
uint getSampleRate()
Undocumented in source. Be warned that the author may not have intended to support it.
isReady
bool isReady()
Undocumented in source. Be warned that the author may not have intended to support it.
loadFromMemory
bool loadFromMemory(ubyte[] data, HipAudioEncoding encoding, HipAudioType type, void delegate(in ubyte[]) onSuccess, void delegate() onFailure)

Should implement the specific loading here

loadStreamed
uint loadStreamed(ubyte[] data, HipAudioEncoding encoding)

Saves which data should be decoded and do 1 decoding frame

onDispose
void onDispose()
Undocumented in source. Be warned that the author may not have intended to support it.
onFinishLoading
void onFinishLoading()
Undocumented in source. Be warned that the author may not have intended to support it.
onUpdateStream
void onUpdateStream(ubyte[] data, uint decodedSize)

Event method called when the stream is updated

pollFreeBuffer
HipAudioBuffer pollFreeBuffer()

Attempts to get a buffer from the buffer recycler. Used for when loadStreamed must set a buffer available

setBufferAvailable
void setBufferAvailable(HipAudioBuffer buffer)
Undocumented in source. Be warned that the author may not have intended to support it.
setBufferData
void setBufferData(HipAudioBuffer* buffer, ubyte[] data, uint size)

The buffer is actually any kind of external API buffer, it is the buffer contained in HipAudioBufferWrapper.

updateStream
uint updateStream()

Decodes a bit more of the current buffer

Variables

chunkSize
uint chunkSize;

Unused for non streamed

dataToDecode
ubyte[] dataToDecode;

Unused for non streamed. It is the binary loaded from a file which will be decoded

decoder
IHipAudioDecoder decoder;
Undocumented in source.
encoding
HipAudioEncoding encoding;
Undocumented in source.
fileName
string fileName;
Undocumented in source.
hint
HipAudioClipHint hint;
Undocumented in source.
isStreamed
bool isStreamed;
Undocumented in source.
outBuffer
ubyte[] outBuffer;

Unused for non streamed. Where the user will get its audio decoded.

totalDecoded
size_t totalDecoded;
Undocumented in source.
type
HipAudioType type;
Undocumented in source.

Inherited Members

From HipAsset

_name
string _name;

Use it to insert into an asset pool, alias

_assetID
uint _assetID;

Currently not in use

_typeID
uint _typeID;

Usage inside asset manager

loadTime
float loadTime;

How much time it took to load, in millis

name
string name()
Undocumented in source. Be warned that the author may not have intended to support it.
name
string name(string newName)
Undocumented in source. Be warned that the author may not have intended to support it.
assetID
uint assetID()
Undocumented in source. Be warned that the author may not have intended to support it.
typeID
uint typeID()
Undocumented in source. Be warned that the author may not have intended to support it.
onFinishLoading
void onFinishLoading()

Action for when the asset finishes loading Proabably be executed on the main thread

isReady
bool isReady()
Undocumented in source.
onDispose
void onDispose()

Use it to clear the engine.

startLoading
void startLoading()
Undocumented in source. Be warned that the author may not have intended to support it.
finishLoading
void finishLoading()
Undocumented in source. Be warned that the author may not have intended to support it.
dispose
void dispose()

Currently, no AssetID recycle is in mind. It will only invalidate the asset for disposing it on an appropriate time

Meta